//
//  UIView+SunLayout.h
//  test
//
//  Created by sunshine on 16/10/8.
//  Copyright © 2016年 sun. All rights reserved.
//

#import <UIKit/UIKit.h>
typedef enum SunSide{
    SunLeft = NSLayoutAttributeLeft,
    SunRight = NSLayoutAttributeRight,
    SunTop = NSLayoutAttributeTop,
    SunBottom = NSLayoutAttributeBottom,
    SunWidth = NSLayoutAttributeWidth,
    SunHeight = NSLayoutAttributeHeight,
    SunCenterX = NSLayoutAttributeCenterX,
    SunCenterY = NSLayoutAttributeCenterY,
    SunMarginLeft = NSLayoutAttributeLeftMargin,
    SunMarginRight = NSLayoutAttributeRightMargin,
    SunMarginTop = NSLayoutAttributeTopMargin,
    SunMarginBottom = NSLayoutAttributeBottomMargin
}SunSide;
typedef struct SunEdge {
    CGFloat one, two, three, four;
} SunEdge;
UIKIT_STATIC_INLINE SunEdge SunEdgesMake(CGFloat one, CGFloat two, CGFloat three, CGFloat four) {
    SunEdge insets = {one, two, three, four};
    return insets;
}
@interface UIView (Sun)
// all
- (float)sun_getTop;
- (float)sun_getLeft;
- (float)sun_getBottom;
- (float)sun_getRight;
- (float)sun_getWidth;
- (float)sun_getHeight;
- (float)sun_getCenterX;
- (float)sun_getCenterY;

- (void)fm_XcenterTo:(UIView *)view;
- (void)fm_YcenterTo:(UIView *)view;
- (void)fm_XYcenterTo:(UIView *)view;
- (void)fm_widthRelyHeight:(CGFloat)size;
- (void)fm_heightRelyWidth:(CGFloat)size;
- (void)fm_setWidth:(float)width;
- (void)fm_setHeight:(float)height;
- (void)fm_setSize:(CGSize)size;
- (void)fm_setTop:(float)top to:(UIView *)view;
- (void)fm_setLeft:(float)left to:(UIView *)view;
- (void)fm_setBottom:(float)bottom to:(UIView *)view;
- (void)fm_setRight:(float)right to:(UIView *)view;
- (void)fm_setLeft:(float)left to:(UIView*)LView Right:(float)right to:(UIView*)RView;
- (void)fm_setTop:(float)top to:(UIView*)TView Bottom:(float)bottom to:(UIView*)BView;
- (void)fm_All:(SunEdge)edges;
- (void)fm_Top:(SunEdge)edges to:(UIView *)view;
- (void)fm_Left:(SunEdge)edges to:(UIView *)view;
- (void)fm_Bottom:(SunEdge)edges to:(UIView *)view;
- (void)fm_Right:(SunEdge)edges to:(UIView *)view;

@property(nonatomic,strong)NSMutableArray *ltArr;
- (NSMutableArray *)ltArr;
- (void)autolayout;
- (void)lt_removeAllCons;
- (void)changeSize:(float)size save:(BOOL)save;
- (void)lt_XcenterTo:(UIView *)view save:(BOOL)save;
- (void)lt_YcenterTo:(UIView *)view save:(BOOL)save;
- (void)lt_XYcenterTo:(UIView *)view save:(BOOL)save;
- (void)lt_bottomEqual:(UIView *)view save:(BOOL)save;
- (void)lt_topEqual:(UIView *)view save:(BOOL)save;
- (void)lt_leftEqual:(UIView *)view save:(BOOL)save;
- (void)lt_rightEqual:(UIView *)view save:(BOOL)save;
- (void)lt_layoutView:(UIView *)view side:(SunSide)side to:(UIView *)tView toSide:(SunSide)tSide withSize:(float)size offset:(float)offset save:(BOOL)save;
- (void)lt_widthRelyHeight:(CGFloat)size save:(BOOL)save;
- (void)lt_heightRelyWidth:(CGFloat)size save:(BOOL)save;
- (void)lt_setWidth:(float)width save:(BOOL)save;
- (void)lt_setHeight:(float)height save:(BOOL)save;
- (void)lt_setSize:(CGSize)size save:(BOOL)save;
- (void)lt_setTop:(float)top to:(UIView *)view save:(BOOL)save;
- (void)lt_setLeft:(float)left to:(UIView *)view save:(BOOL)save;
- (void)lt_setBottom:(float)bottom to:(UIView *)view save:(BOOL)save;
- (void)lt_setRight:(float)right to:(UIView *)view save:(BOOL)save;
- (void)lt_setLeft:(float)left to:(UIView*)LView Right:(float)right to:(UIView*)RView save:(BOOL)save;
- (void)lt_setTop:(float)top to:(UIView*)TView Bottom:(float)bottom to:(UIView*)BView save:(BOOL)save;
- (void)lt_All:(SunEdge)edges save:(BOOL)save;
- (void)lt_Top:(SunEdge)edges to:(UIView *)view save:(BOOL)save;
- (void)lt_Left:(SunEdge)edges to:(UIView *)view save:(BOOL)save;
- (void)lt_Bottom:(SunEdge)edges to:(UIView *)view save:(BOOL)save;
- (void)lt_Right:(SunEdge)edges to:(UIView *)view save:(BOOL)save;
@end
